<template>
  <div>
    <NavBar/>

    <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
      <van-swipe-item v-for="item in bannerList" :key="item.bannerId" @click="goToDetail(item.actionData)">
        <img :src="item.imgUrl" style="width: 100%; display: block;" alt="">
      </van-swipe-item>
    </van-swipe>

    <FilmHeader/>
    

		<router-view></router-view>

    <div class="zhanwei"></div>
    <BackTop/>
  </div>
</template>

<script>
// import { GetHomeData } from '../request/api'
import http from '../request/http'
import NavBar from '../components/NavBar.vue'
import FilmHeader from './film/FilmHeader.vue'
import BackTop from '../components/BackTop.vue'
export default {
  name: 'Film',
  data() {
    return {
      bannerList: [],
    }
  },
  methods: {
    goToDetail(val) {
      let myid = JSON.parse(val).businessId
      this.$router.push('/detail/' + myid)
    }
  },
  components: {
    NavBar,
    FilmHeader,
    BackTop
  },
  mounted() {
    http({
      url: '/gateway?type=2&cityId=130100&k=6313855',
      headers: {
        'X-Host': 'mall.cfg.common-banner'
      }
    }).then(res => {
      if (res.status == 0) {
        let { data } = res
        this.bannerList = data
      }
    })
  }
}
</script>

<style scoped>
.zhanwei {
  height: .5rem;
}
</style>